#include "Resource.h"

#define FILE_NAME   "ball.bmp"

SDL_Surface *ball_bmp = NULL;
SDL_Texture *ball_Texture = NULL;

int Resource_Load(SDL_Renderer *renderer)
{
    ball_bmp = SDL_LoadBMP(FILE_NAME);
    if (ball_bmp == NULL) {
        SDL_Log("Can not load bmp, %s", SDL_GetError());
        return 1;
    }
    
    ball_Texture = SDL_CreateTextureFromSurface(renderer, ball_bmp);
    SDL_FreeSurface(ball_bmp);
    
    return 0;
}

SDL_Texture * Resource_GetBallTexture()
{
    return ball_Texture;
}

void Resource_Unload()
{
    SDL_DestroyTexture(ball_Texture);
}